package comday08.itheima02;

public class Demo02 {
    public static void main(String[] args) {

        StringBuilder sb = new StringBuilder();

        //append()   :给StringBuilder添加(追加)任意类型的内容
        sb.append(123);
        sb.append("abc");
        sb.append(3.14);
        sb.append(true);

        //会把所有数据依次添加到对象上
        System.out.println(sb);    //"123abc3.14true"


        //reverse() :把内容反转
        sb.reverse();
        System.out.println(sb);   //"eurt41.3cba321"

        //length()  :获取内容的长度
        int i = sb.length();
        System.out.println(i);    //14

        //toString()  ：把对象转成String类型
        String s = sb.toString();
        System.out.println(s);    //"eurt41.3cba321"

    }
}
